# -*- encoding=utf8 -*-
__author__ = "Administrator"
# auto_setup(__file__)
from airtest.core.api import *

# from selenium import webdriver
# from selenium.webdriver.common.keys import Keys
# from airtest_selenium.proxy import WebChrome
# driver = WebChrome()
# driver.implicitly_wait(20)



# driver.get("http://www.baidu.com")
# driver.find_element_by_id("kw").send_keys("蜗牛学院")
# driver.find_element_by_xpath("//input[@type='submit']").click()
# driver.find_element_by_link_text("...Java|软件测试|Web前端|网络安全|UI设计培训...").click()
# driver.switch_to_new_tab()
# driver.refresh()
# driver.assert_exist("//*[@id=\"nav_text\"]/li[9]", "xpath", "success")
# driver.quit()

# driver.get("http://localhost:8080/woniusales/")
# driver.find_element_by_id("username").send_keys("admin")
# driver.find_element_by_xpath("//input[@type='password']").send_keys("admin123")
# driver.find_element_by_id("verifycode").send_keys("0000")
# driver.find_element_by_xpath("//button[@onclick=\"doLogin('null')\"]").click()
# driver.assert_exist("//a[@href='/woniusales/user/logout']", "xpath", "success")
# driver.quit()



from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from airtest_selenium.proxy import WebChrome
driver = WebChrome()
driver.maximize_window()
driver.implicitly_wait(20)

driver.get("http://www.woniuxy.com")
driver.airtest_touch(Template(r"./images/tpl1619505452087.png", record_pos=(0.038, -0.207), resolution=(1920, 1080)))
driver.switch_to_new_tab()
driver.airtest_touch(Template(r"./images/tpl1619505405194.png", record_pos=(-0.14, 0.08), resolution=(1920, 1080)))
# touch(Template(r"./images/tpl1619506226310.png", record_pos=(0.011, -0.082), resolution=(1920, 1080)))
driver.airtest_touch(Template(r"./images/tpl1619505492452.png", record_pos=(-0.152, -0.098), resolution=(1920, 1080)))
driver.find_element_by_id("keyword").send_keys("笔记")
time.sleep(5)
driver.quit()




